/*
 * @author: Lzg
 */
// 输出口
var PageDo = {
    id: "PageDo", //页面id
    menu: "i18n.lan.menu.io", //所属菜单(一级菜单名)
    title: "i18n.lan.menu.PageDo", //标题（二级菜单名）
    icon: "icon-me-do", //图标
    refreshBtnCmd: "DUMP_CORE,IOS_DUMPS", //刷新按钮指令
    saveBtn: true, //保存按钮
    content: "test", //页面内容
    el: [ //控件  
        {//css定义
            elname:"style",
            text:"#PageDo > label{min-width:140px;}",
        },  
        {
            elname: "checkbox",
            label: i18n.lan.PageDo.anonymousSmsControl,
            id: "do_anonymousSmsControl",
            endRow: true,
            attrs: {
                dumpKey: "ANONYMOUS_SMS",
                cmdKey: "ANONYSMS",
            }
        },
        {
            elname: "text",
            label: i18n.lan.PageDo.sirenTime,
            attrs: {
                dumpKey: "SIRENTO",
                cmdKey: "SIRENTO"
            },
        },
        {
            elname: "button",
            text: i18n.lan.PageDo.stopSiren,
            endRow: true,
            attrs: {
                titie: "SIRENSTOP",
                onclick: "sendCmd('SIRENSTOP')",
                class: "smallBtn"
            },
        },
        {
            elname: "datagrid",
            rowCount: Device.getNodesCount("do"),
            data: {
                width: "640px",
                columns: [
                    [ //表格列,field为列标题
                        {
                            field: "index",
                            width: 40,
                            align: "center",
                        },
                        {
                            field: "state",
                            dumpKey: "DO<n>STATE",
                            width: 100,
                        },
                        // {field:"normalState"},
                        {
                            field: "pluseTime",
                            editor: Easyui.editor.numberbox,
                            dumpKey: "DO<n>SET",
                            dumpParamIndex: 0,
                            dealDumpParam:"parseInt(value)/1000",
                            cmdKey: "DO<n>PULSETO",
                            getValue:"value*1000",
                            width: 150,
                        },
                        {
                            field: "siren",
                            formatter:Easyui.formatter.checkbox,
                            editor: Easyui.editor.checkbox,
                            dumpKey: "DO<n>SET",
                            dumpParamIndex: 3,
                            cmdKey: "DO<n>SIREN",
                            width: 80,
                            align: "center",
                        },
                        {//保存输出口状态
                            field: "saveDoState",
                            formatter:Easyui.formatter.checkbox,
                            editor: Easyui.editor.checkbox,
                            dumpKey: "DO<n>SET",
                            dumpParamIndex: 1,
                            cmdKey: "DO<n>SAVE",
                            width: 120,
                            align: "center",
                        },
                        {
                            field: "uploadTimer",
                            editor: Easyui.editor.numberbox,
                            dumpKey: "DO<n>IOTTO",
                            cmdKey: "DO<n>IOTTO",
                            width: 120,
                        },
                    ]
                ],
            }
        },
    ],
}
CmdPage.add(PageDo); //添加到页面管理
